<?php
include_once("Upload.php");
//include_once("MySqlClass.php");




//.$_FILES["file"]["name"]

//umask(027);

$handle = new upload($_FILES['file']);
if ($handle->uploaded) {
    $handle->file_new_name_body   = 'image_resized';
    //$handle->image_resize         = true;
    //$handle->image_x              = 100;
    //$handle->image_ratio_y        = true;
    //$handle->file_new_name_ext = 'jpg';
    $handle->file_overwrite = true;
    //$handle->file_max_size = '1024';//10M
    //$handle->image_convert = 'jpg';
    //$handle->image_text = 'Holo';
    $handle->auto_create_dir = true;
    $handle->process('../../data/');
    if ($handle->processed) {
        echo '{ "success" : true,
                "file":"rezized"
               }';
        $handle->clean();
    } else {
        //.$handle->error.
        echo '{ "success" : false,
                "msg" : "'.$handle->error.'"
               }';
    }
 
}else{  
   echo '{ "success" : false,
        "msg" : "not file was send"
       }'; 
}




?>